package com.jt.tenant.conn;

import com.jt.tenant.app.JTApplication;
import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by AD on 2016/5/16.
 */
@HttpInlet(Conn.INLET_SUBMIT_MAINTENANCETIME)
public class SetMaintenanceTime extends JTAsyGet<SetMaintenanceTime.Info> {
    public String token = JTApplication.jtPreferences.readToken();
    public String obdid = JTApplication.jtPreferences.readOdbID();
    public String userid = JTApplication.jtPreferences.readUserID();

    public String lastMaintenanceTime;
    public String lastMaintenanceDistance;
    public String MaintenanceTimeSpace;
    public String MaintenanceDistanceSpace;
    public String remind;

    public SetMaintenanceTime(AsyCallBack<Info> asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected Info parser(JSONObject object) {
        JSONObject apiTYF = object.optJSONObject("apiTYF");

        JSONObject head = apiTYF.optJSONObject("head");

        Info info = new Info();

        info.msg = head.optString("msg");

        if(!info.msg.equals("000")){
            TOAST = "提交失败";
        }


        return info;
    }

    public static class Info{
        public String msg;
    }

}
